<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>我的评价</title>
    <script type="text/javascript" src="__PUBLIC__/Js/home/jquery-1.11.3.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Js/layer/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/home/user_common.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/home/user_main_left.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/home/evaluate.css">
    <script>
        $(function () {
            //订单按钮 添加事件
            $('.member_all-nav-ul li').each(function (index) {
                $(this).click(function () {
                    $('.member_all-nav-ul li').removeClass();
                    $(this).addClass('member_all-nav-click');
                    if (index == 0) {
                        $('.wait_evaluate').removeAttr('style');
                        $('.done_evaluate').attr('style', 'display:none');
                    } else {
                        layer.load(1);
                        $('.done_evaluate .member_ask-table tr:gt(0)').remove();
                        $.post(
                                '__URL__/doneEvaluate',
                                function(data){
                                    layer.closeAll('loading');
                                    $('.done_evaluate .member_ask-table').append(data['content']);
                                },
                                'json'
                        );
                        $('.done_evaluate').removeAttr('style');
                        $('.wait_evaluate').attr('style', 'display:none');
                    }
                });
            });
        });
        //调出评价窗口
        function evaluate(order_detail_id,goods_id,status){
            //iframe层-父子操作
            layer.open({
                type: 2,
                area: ['350px', '320px'],
                title: '商品评价',
                fix: false, //不固定
                maxmin: true,
                content: '__URL__/evaluate_edit/order_detail_id/'+order_detail_id+'/goods_id/'+goods_id+'/status/'+status
            });
        }
        //追加评论
        function addEvaluate(order_detail_id,goods_id,status){
            //iframe层-父子操作
            layer.open({
                type: 2,
                area: ['350px', '320px'],
                title: '追加评价',
                fix: false, //不固定
                maxmin: true,
                content: '__URL__/evaluate_edit/order_detail_id/'+order_detail_id+'/goods_id/'+goods_id+'/status/'+status
            });
        }
        //平轮成功后对未评论的商品数量做修改     在iframe中调用
        function change_num(){
            var show=$('.wait_evaluate_num');
            //获取原有的未评论的商品的数量
            var old_num=show.text();
            var num=parseInt(old_num)-1;
            show.html(num);
            $('.member_all-nav-right em').html(num+'件');
        }
    </script>
</head>
<body>
<!--引入页面头部-->
<include file="Common/header"/>
<div class="cort">
    <div class="tobuy cmain">
        <div class="cmain mb_back">
            <div class="zbk_top spalid">
                <span>您当前的位置：</span>
                <span><a href="__MODULE__/Index/index" target="_top">Darry Ring</a></span>
                <span><em>&gt;</em></span>
                <span><a href="__MODULE__/User/index" target="_top">我的DR</a></span>
                <span><em>&gt;</em></span>
                <span>我的评价</span>
            </div>
            <div class="member_cort">
                <!--引入左导航栏-->
                <include file="Common/user_main_left"/>
                <!--右边的主要内容-->
                <div class="member_cort-right fr">
                    <!--我的评价-->
                    <div class="member_ask">
                        <!--切换nav-->
                        <div class="member_all-nav">
                            <div class="member_all-nav-top">
                                <ul class="member_all-nav-ul fl">
                                    <li class="member_all-nav-click">待评论商品(<span class="wait_evaluate_num">{$order_goods|count}</span>)</li>
                                    <li>已发表的评论</li>
                                </ul>
                                <!--右边-->
                                <div class="member_all-nav-right fr">
                                    <i class="member_tz"></i>
                                    <span>您可以对已成功购买的&nbsp;<em>{$order_goods|count}件</em>&nbsp;商品进行评论,和大家说说您的切身感受吧。</span>
                                </div>
                                <!--右边end-->
                            </div>
                            <!--黄色线-->
                            <div class="member_all-nav-line"></div>
                            <!--黄色线end-->
                        </div>
                        <!--切换nav end-->
                        <!--评论以及已经评论-->
                        <div class="member_ask-all">
                            <!--评论的产品-->
                            <div class="member_news-it wait_evaluate">
                                <table class="member_ask-table" border="0" cellpadding="0" cellspacing="0">
                                    <tr class="ask-table-trfirst">
                                        <td class="ask-table-td0">订单</td>
                                        <td class="ask-table-td0">商品</td>
                                        <td class="ask-table-td0">购买时间</td>
                                        <td class="ask-table-td0">操作</td>
                                    </tr>
                                    <!--遍历未评价的商品-->
                                    <foreach name="order_goods" item="v">
                                        <tr id="evaluate{$v['id']}">
                                            <td>{$v['order_id']}</td>
                                            <td><a href="__MODULE__/Goods/details/id/{$v['goods_detail_id']}">{$v['goods_style']}{$v['goods_name']}</a></td>
                                            <td>{$v['addtime']}</td>
                                            <td><a href="JavaScript:evaluate({$v['id']},{$v['goods_id']},0)">评价</a></td>
                                        </tr>
                                    </foreach>
                                </table>
                            </div>
                            <!--评论的产品end-->
                            <!--已发表的评论-->
                            <div class="member_news-it done_evaluate" style="display: none;">
                                <table class="member_ask-table" border="0" cellpadding="0" cellspacing="0">
                                    <tr class="ask-table-trfirst">
                                        <!--<td style="width: 10%">订单</td>
                                        <td style="width: 15%">商品</td>
                                        <td style="width: 45%;overflow: hidden;">评论内容</td>
                                        <td style="width: 15%">评论时间</td>
                                        <td style="width: 15%">操作</td>-->
                                        <td style="width: 10%">订单</td>
                                        <td style="width: 15%">商品</td>
                                        <td style="width: 65%">订单时间</td>
                                        <td style="width: 10%">操作</td>
                                    </tr>
                                </table>
                            </div>
                            <!--已发表的评论end-->
                        </div>
                        <!--评论以及已经评论end-->
                    </div>
                    <!--我的评价end-->
                </div>
                <!--右边的主要内容end-->
            </div>
        </div>
    </div>
</div>
<!--引入页面底部-->
<include file='Common/footer'/>
</body>
</html>